﻿using Eleven.BreakAway.Model;
using System.Data.Entity;

namespace Eleven.BreakAway.DataAccess
{
    public class BreakAwayContext : DbContext
    {
        public DbSet<Lodging> Lodgings { get; set; }

        public DbSet<Destination> Destinations { get; set; }

        public DbSet<Trip> Trips { get; set; }

        public DbSet<Person> Persons { get; set; }

        public DbSet<Activity> Activities { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new LodgingConfiguration());
            modelBuilder.Configurations.Add(new DestinationConfiguration());
            modelBuilder.Configurations.Add(new TripConfiguration());
            modelBuilder.Configurations.Add(new PersonConfiguration());
            modelBuilder.Configurations.Add(new AddressConfiguration());
            modelBuilder.Configurations.Add(new InternetSpecialConfiguration());
            modelBuilder.Configurations.Add(new ActivityConfiguration());
            modelBuilder.Configurations.Add(new PersonPhotoConfiguration());

            //modelBuilder.ComplexType<Address>();
            modelBuilder.ComplexType<PersonInfo>();
        }
    }
}
